package com.newviews.tcmip.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.newviews.tcmip.pojo.po.EtcmHerbExPo;
import com.newviews.tcmip.pojo.po.EtcmIngrExPo;
import com.newviews.tcmip.pojo.po.EtcmIngrPo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;

/**
 * <p>
 * 组成成分基础信息 Mapper 接口
 * </p>
 *
 * @author lxc
 * @since 2024-03-01
 */

@Mapper
@CacheConfig(cacheNames = "EtcmStatistics")
public interface EtcmIngrMapper extends BaseMapper<EtcmIngrPo> {

    IPage<EtcmIngrPo> getAdmetPageByHerb(Page<Object> objectPage,@Param(Constants.WRAPPER) QueryWrapper<EtcmIngrPo> wrapper);

    List<EtcmIngrExPo> downloadAdmet(@Param(Constants.WRAPPER) QueryWrapper<EtcmHerbExPo> wrapper, @Param("uiTypeCode") String uiTypeCode, @Param("langCode") String langCode);

    @Cacheable(value = "IngrCount")
    int indexIngrCount();
}
